home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wonky Flux Batch 2019 02
/
Wonky_Flux_Batch_2019-02.zip
/
Wonky Flux Batch 2019-02
/
075 - Clash of Arms.dsk
/
WAR.START.S
< prev
next >
Wrap
Text File
|
2019-02-17
|
23KB
|
692 lines
; *************************
; ** **
; * lash of rms *
; * Startup Segment *
; ** **
; *************************
public MainCommand
public FromNew
public QuitGame
public TermGame
pt=0
setint(chr$(29)):print chr$(5);chr$(1,info(2)*15);:pt=(key(0)=29):setint("")
if info(0)=0 pt=1
store "h:vars"
on nocar goto termgame
poke 34,0
dr$="b:"
an=not(pt)
gosub home
gosub CheckBar
print chr$(12)
if pt copy dr$+"clash.title":gosub credits:goto Restart
print \chr$(45,78)
print \" Welcome to:"
print \" Clash of Arms"
print \chr$(45,78)
gosub credits
print \" Emulation: VT100/ANSI"
print \chr$(45,78)
Restart
gosub ScanMaster
if gp=0 print \"You are not currently playing in any game.":goto premain
print \"You are playing in game #"gp". ";
print "Please wait...";
gn$=str$(gp)
kill "h:war.map1":create "h:war.map1"
open #2,"h:war.map1":open #1,dr$+"war.map1."+gn$
for ka=0 to 45:position #1,80,ka:input #1,ka$
position #2,80,ka:print #2,ka$
next
close
kill "h:war.map2":create "h:war.map2"
open #2,"h:war.map2":open #1,dr$+"war.map2."+gn$
for ka=0 to 45:position #1,80,ka:input #1,ka$
position #2,80,ka:print #2,ka$
next
close
kill "h:attacks":create "h:attacks":open #1,dr$+"attacks."+gn$
open #2,"h:attacks"
for p1=0 to 5
for p2=0 to 5
position #1,60,p1,10*p2:input #1,ka
position #1,60,p1,(10*p2)+5:input #1,kb
position #2,60,p1,10*p2:print #2,ka
position #2,60,p1,(10*p2)+5:print #2,kb
next
next
close
print chr$(8,14);chr$(32,14);chr$(8,14)
premain
gosub PrintNews
ready "g:war.mail"
if not msg(un) goto MainCommand
print \"A soldier informs you that some messages are waiting in the embassy.."\
link "a:war.mail","rd.mail"
MainCommand
close
on nocar goto termgame
print \"Clash of Arms (?=Help): ";:input kb$
if (kb$="?") and pt print chr$(12);:setint(" "):copy dr$+"coa.menu":gosub invoff:goto MainCommand
if kb$="?" goto PrintMenu
if kb$="H" link "a:war.help1"
if kb$="P" goto PlayGame
if (kb$="*") and info(5) link "a:war.sysop.seg"
if kb$="L" gosub ListGames:goto MainCommand
if kb$="Q" recall "h:vars":kill "h:vars":gosub topscrn:link "a:main.seg","fromsys"
if kb$="J" goto JoinGame
if kb$="V" gosub GetGame:goto ViewGame
if kb$="D" link "a:war.mail"
if kb$="F" goto HallFame
if kb$="M" goto mapview
if kb$="S" goto Surrender
if kb$="^" goto switch
print \"Invalid command":goto MainCommand
PrintMenu
setint(" ")
copy dr$+"coa.main.menu"
setint(""):goto MainCommand
CheckBar
if pt=0 return
print chr$(30) ;chr$(32);chr$(33);
print chr$(15) ;"Your status bar is on! Turn it off, then press return."
print chr$(14) ;"Press return to continue"
print chr$(30) ;chr$(32);chr$(32);chr$(10);chr$(25);
input @3 ka$
return
ViewGame
if gn=0 goto MainCommand
input \"View Command (?=Help): ";ka$
if ka$="?" print \"Current game: ";gn
if ka$="?" print '
View: P: Players
M: Map
K: Kills
G: View different game
Q: Quit':goto ViewGame
if ka$="G" gosub GetGame:goto ViewGame
if ka$="P" gosub ListPlayers
if ka$="M" gosub ViewMap
if ka$="K" gosub PrintKills
if ka$="Q" goto MainCommand
goto ViewGame
printkills
gosub home
copy dr$+"kills"
open #1,dr$+"attacks."+gn$
for p1=0 to 5
for p2=0 to 5
position #1,60,p1,(10*p2)+5
input #1,qn
y=p1+9:x=(11*p2)+12:gosub screen
print "| "qn;
next
next
x=1:y=16:gosub screen
close
return
ViewMap
gosub Home
open #1,dr$+"war.map1."+str$(gn)
for ka = 1 to 23:input #1,ka$:print ka$:next
print "Press Q to quit, any other key for rest of map.";:get ka$
if ka$="Q" close:return
x=1:y=23:gosub Screen
for ka = 1 to 23:input #1,ka$:print ka$:next
close
return
ListPlayers
open #1,dr$+"GAME.DATA."+gn$
open #2,dr$+"WAR.MASTER"
print \"List of players:"\
print "# Code Name Last Played # of Cities/Armies"
print "---------------------------------------------------------------------"
for ka = 1 to 6
position #2,35,(gn-1),(ka-1)*5:input #2,kb
if kb=0 goto List1
print left$(str$(kb)+" ",5);
print mid$("ABCDEF",ka,1)" ";
position #1,1,(ka-1)*25:input #1,ka$:print left$(ka$+chr$(46,25),25);
position #1,1,(ka-1)*10+150:input #1,ka$:print ka$" ";
position #1,1,(ka-1)*5+270:input #1,kb:print kb"/";
position #1,1,(ka-1)*5+300:input #1,kb:print kb
List1
next
close
return
JoinGame
if gp<>0 print \"You are already in a game!":goto MainCommand
print '
You will be placed in a game. As soon as there are six players, the game will
start. You will be notified in E-Mail when you can begin play.
This game requires you to call frequently, preferably every day. Read the
H)elp file for more information. If you do not plan on actively participating,
then do not Join the game.
In order to play this game, you MUST have ProTERM Special, Datamedia, VT-100,
or ANSI emulation. Please do not join a game if your terminal program is not
capable of any of the above emulations.'
input \"Are you sure you want to join a game? (Y/[N]): ";ka$
if ka$ <> "Y" goto MainCommand
open #1,dr$+"Game.to.join":input #1,ka$:close
gn=val(ka$):if gn=0 gn=1
open #1,dr$+"war.master"
JoinLoop
for kb = 1 to 6
position #1,35,gn-1,30:input #1,ka:if ka kb=6:goto PastAdd
position #1,35,gn-1,(kb-1)*5:input #1,ka$
if (val(ka$)=0) and (ka$<>"0") close:gosub NewFile
if val(ka$)=0 close:gosub AddPlayer:kb=6
PastAdd
next
if gn=0 goto Restart
gn=gn+1:goto JoinLoop
NewFile
gn$=str$(gn)
print \"Five moments please";
kill dr$+"GAME.DATA."+gn$:create dr$+"GAME.DATA."+gn$
open #1,dr$+"GAME.DATA."+gn$
for ka = 0 to 125 step 25
position #1,1,ka:print #1,"Empty"
next
for ka = 150 to 200 step 10
position #1,1,ka:print #1,"00/00/00"
next
for ka = 210 to 295 step 5
position #1,1,ka:print #1,0
next
for ka = 300 to 325 step 5
position #1,1,ka:print #1,4
next
close
print "." ;
open #1,dr$+"war.master"
for ka = 1 to 6
position #1,35,(gn-1),(ka-1)*5:print #1,0
position #1,35,(gn-1),30:print #1,0
next
close
print "." ;
gosub NewGameFiles
return
NewGameFiles
kill dr$+"attacks."+gn$:create dr$+"attacks."+gn$:open #1,dr$+"attacks."+gn$
for p1=0 to 5
for p2=0 to 5
position #1,60,p1,10*p2:print #1,0
position #1,60,p1,(10*p2)+5:print #1,0
next
next
close
print "." ;
kill dr$+"war.map1."+gn$:create dr$+"war.map1."+gn$
open #1,dr$+"war.map1":open #2,dr$+"war.map1."+gn$:copy #1,#2:close
print "." ;
kill dr$+"war.map2."+gn$:create dr$+"war.map2."+gn$
open #1,dr$+"war.map2":open #2,dr$+"war.map2."+gn$:copy #1,#2:close
print "."
return
AddPlayer
gn$=str$(gn)
print \"You will be player #"kb" in game #"gn"."
open #1,dr$+"war.master"
position #1,35,(gn-1),(kb-1)*5:print #1,un
close
open #1,dr$+"game.data."+gn$
position #1,1,(kb-1)*25:print #1,a3$
position #1,1,((kb-1)*10)+150:print #1,date$
close
kill dr$+"game.to.join":create dr$+"game.to.join":open #1,dr$+"game.to.join"
if kb<>6 print #1,gn
if kb=6 print #1,0
close
if kb=6 print \"You are the sixth player, so the game will start now!"
if kb=6 print \"Notifying other players...":link "a:war.sysop.seg","BeginGame"
gn=0:return
PlayGame
gn=gp:gn$=str$(gn)
if gn=0 print \"You are not playing in a game yet!"
open #1,dr$+"war.master"
position #1,35,(gn-1),30:input#1,ka
if ka=0 print '
This game has not been started yet. If no one new has joined this game for a
while, ask the sysop to start it for you.':close:goto MainCommand
kc=0
for ka = 1 to 6
position #1,35,(gn-1),(ka-1)*5:input #1,kb:if un=kb pn=ka
if kb kc=kc+1
next
close
if ka$="S" return
; The Surrender calls this routine to find player number...
if kc=1 gosub Winner:goto Restart
pc$ = mid$("abcdef",pn,1)
gosub RecentAttacks
print \" Player number: "pn
print " Character: "pc$
open #1,dr$+"game.data."+gn$
position #1,1,(pn-1)*10+150:input #1,kd$
gosub CountDays
position #1,1,(pn-1)*10+150:print #1,date$
close
if x1=0 print \"You have played today";:if ((info(5)) or (un=37)) print ", but since you are the sysop, you can play anyway.";
if x1=0 print ""
if peek(-16287)>127 poke -16287,0:goto pastply
if (x1=0) and not(info(5)) goto MainCommand
pastply
kk=x1-1
if x1<=1 nm=3:else nm=3+(2*kk)
if nm>9 nm=9
print "Days since last played: "x1
if x1>1 print \"Since you missed a few turns, you are allowed "nm" moves/army this turn."\
open #1,dr$+"game.data."+gn$
position #1,1,(pn-1)*5+210:input #1,ka:ka=ka+x1
position #1,1,(pn-1)*5+210:print #1,ka
position #1,1,(pn-1)*5+240:input #1,ab
position #1,1,(pn-1)*5+300:input #1,kz
position #1,1,(pn-1)*5+270:input #1,ct
if (kz+ct)=0 close:goto Loser
if ka<3 print "Turns until New Armies: "3-ka:goto nonewarmies
ka=ka-3:position #1,1,(pn-1)*5+210:print #1,ka
ab=ab+ct
print " New armies: "ct"!"
position #1,1,(pn-1)*5+240:print #1,ab
NoNewArmies
close
print " Unplaced armies: "ab
if ab=0 goto PastPlace
AskLoop
print \"Do you want to place some armies now? (Y/N): ";
input ka$
if ka$ = "N" goto PastPlace
if ka$ <> "Y" goto AskLoop
kz=ab
if (pt) or (an) link "a:new.army2":else link "a:new.army"
FromNew
close
open #1,dr$+"game.data."+gn$
position #1,1,(pn-1)*5+300
input #1,kb
kb=kb+(kz-ab)
position #1,1,(pn-1)*5+300
print #1,kb
position #1,1,(pn-1)*5+240:print #1,ab
close
PastPlace
if (peek(-16287)>127) and (info(5)) link "a:war.move3"
if (pt) or (an) link "a:war.move2":else link "a:war.move"
TermGame
close
recall "h:vars"
kill "h:vars"
gosub SaveFiles
link "a:main.seg","term1"
QuitGame
close
gosub home
gosub SaveFiles
goto MainCommand
SaveFiles
if gp=0 return
open #1,dr$+"war.master"
position #1,35,(gn-1),30:input #1,ka
close
if ka=0 return
print \"Saving game";
kill dr$+"war.map1."+gn$:create dr$+"war.map1."+gn$
open #1,"h:war.map1":open #2,dr$+"war.map1."+gn$
for ka=0 to 45:position #1,80,ka:input #1,ka$
position #2,80,ka:print #2,ka$
next
close
print "." ;
kill dr$+"war.map2."+gn$:create dr$+"war.map2."+gn$
open #1,"h:war.map2":open #2,dr$+"war.map2."+gn$
for ka=0 to 45:position #1,80,ka:input #1,ka$
position #2,80,ka:print #2,ka$
next
close
print "." ;
kill dr$+"attacks."+gn$:create dr$+"attacks."+gn$
open #1,"h:attacks":open #2,dr$+"attacks."+gn$
for p1=0 to 5
for p2=0 to 5
position #1,60,p1,10*p2:input #1,ka
position #1,60,p1,(10*p2)+5:input #1,kb
position #2,60,p1,10*p2:print #2,ka
position #2,60,p1,(10*p2)+5:print #2,kb
next
next
close
print "." ;
open #1,dr$+"game.data."+gn$
position #1,1,(pn-1)*5+270:print #1,ct
close
print " Saved."
return
RecentAttacks
kb=(instr(pc$,"ABCDEF"))-1
print ""
open #1,dr$+"game.data."+gn$
open #2,dr$+"attacks."+gn$
ka=0
for p1=0 to 5
position #2,60,p1,(10*kb)
input #2,qt
if qt=0 goto NoAttack
print qt" of your armies were killed by player "chr$(p1+97)". (";
position #1,1,p1*25:input #1,ka$
print ka$")":ka=1
position #2,60,p1,(10*kb):print #2,0
NoAttack
next
if ka=0 print "You were not attacked."
close
return
CountDays
x$="000031059090120151181212243273304334"
x1$=mid$(x$,(val(mid$(kd$,1,2))*3)-2,3)
x1$=str$(val(x1$)+val(mid$(kd$,4,2)))
x2$=mid$(x$,(val(mid$(date$,1,2))*3)-2,3)
x2$=str$(val(x2$)+val(mid$(date$,4,2)))
if val(mid$(kd$,8,1))<>val(mid$(date$,8,1)) x2$=str$(val(x2$)+365)
x1=val(x2$)-val(x1$)
return
ListGames
print '
# # of players In Progress
---- ------------ -----------'
open #1,dr$+"war.master"
ka=1
ListLoop
kc=0
for kb = 1 to 6
position #1,35,ka-1,(kb-1)*5:input #1,ka$
if (val(ka$)=0) and (ka$<>"0") and (ka$<>"D") ka=0
if ka$="D" kc=7
if val(ka$) > 0 kc=kc+1
next
if kc>6 kc=0
if ka=0 close:return
if kc print left$(str$(ka)+" ",5);kc;" ";
position #1,35,(ka-1),30:input #1,kd
if kc=0 ka=ka+1:goto ListLoop
if kd=0 print "No":else print "Yes"
ka=ka+1:goto ListLoop
ScanMaster
open #1,dr$+"war.master"
gp=1:ka=0
ScanLoop
for pn = 1 to 6
position #1,35,(gp-1),(pn-1)*5:input #1,ka$
if len(ka$)<1 gp=0
if val(ka$)=un ka=1
next
if gp=0 close:return
if ka=0 gp=gp+1:goto ScanLoop
close:return
GetGame
input \"Game Number (?=List): ";GN$
if gn$="?" gosub ListGames:goto GetGame
gn=val(gn$)
if gn=0 gn$="0":print "- Aborted -":return
open #1,dr$+"war.master":position #1,35,(gn-1):input #1 ka$:close
if val(ka$)=0 and (ka$<>"0") print '
That game is not being played right now.':goto GetGame
; gn and gn$ = game number
return
StartGame
open #1,dr$+"WAR.MASTER"
for ka = 1 to 6
position #1,35,(gn-1),(ka-1)*5:input #1,kb
if kb=0 goto PastMail
MailUsers
d=kb
edit(0)
print #8,"Clash of Arms Notification:"
print #8,""
print #8,"As of "date$" "time$" enough players have entered the game."
print #8,"You may begin play, in game #"gn"!"
print #8,""
ready "g:mail"
if info(6)<29 print \"Mail bit-map full":return
print #msg(d),un
print #6,"Subj: Clash of Arms"
print #6,"From: War Command Headquarters"
copy #8,#6:print #msg(d),chr$(4);chr$(0);
msg(d)=msg(d)+1:update
PastMail
next
position #1,35,(gn-1),30:print #1,1
close
open #1,dr$+"game.data."+str$(gn)
for ka = 0 to 5
position #1,1,150+(ka*10)
print #1,left$(date$,3);
print #1,right$("0"+ str$(val(mid$(date$,4,2))-1),2);right$(date$,3)
next
close:return
pmcon
z=val(left$(time$,2)):z$=" AM"
if z>12 then z$=" PM":z=z-12
z$=str$(z)+mid$(time$,3,6)+z$:return
PrintNews
ka=0:i$=dr$+"war.news"
kill "h:news":create "h:news":open #2,"h:news"
open #1,i$
input #1,ka$:if len(ka$)<1 close:return
close #1:open #1,i$
copy #1,#2:close:kill i$:create i$:open #1,i$:open #2,"h:news"
NewsLoop
input #2,ka$
if len(ka$)<1 close:return
kd$=left$(ka$,8)
gosub CountDays
if x1>5 goto NewsLoop
if ka=0 print \"--------------------- War Update ---------------------"\:ka=1
print ka$
print #1,ka$
goto NewsLoop
DeleteGame
open #1,dr$+"war.master"
position #1,35,(gn-1),30:print #1,0
position #1,35,(gn-1),0:print #1,"D"
close
for pn=1 to 6:gosub RemovePlayer:next
return
Surrender
if gp=0 print \"You aren't playing in a game."\:goto MainCommand
open #1,dr$+"war.master"
position #1,35,(gn-1),30:input #1,ka
close
if ka=0 print \"The game hasn't even started yet! "\:goto MainCommand
input @2 \"Are you sure you want to surrender? (Y/[N]): ";ka$
if ka$<>"Y" goto MainCommand
ka$="S":gosub PlayGame
; Find player number
open #1,dr$+"war.news":append #1:print #1,date$;": ";
print #1,a3$ ;" has admitted defeat and surrendered!":close
gosub RemovePlayer:goto Restart
RemovePlayer
open #1,dr$+"war.master"
position #1,35,gn-1,(pn-1)*5:print #1,0
close
return
Winner
copy dr$+"win.msg"
gosub DeleteGame
open #1,dr$+"war.news":append #1
print #1,date$ ;": ";a3$;" is a winner!":close
kb=0:open #1,dr$+"attacks."+gn$
for p2=0 to 5
position #1,60,pn,(10*p2)+5:input #1,ka:kb=kb+ka
next:close
open #1,dr$+"top.score":input #1,ka$:input #1,ka:close
if kb>ka kill dr$+"top.score":create dr$+"top.score":open #1,dr$+"top.score":print #1,a3$:print #1,kb
close
if kb>ka print \"You hold the new top score!"\
open #1,dr$+"war.fame":append #1
print #1,"| " ;date$;" ";left$(a3$+chr$(32,40),40);
print #1,left$(str$(kb)+chr$(32,25),20);"|"
close
return
Loser
print '
You do not have any armies or cites left. You have been defeated! You may now
join another game if you wish.
Please wait...'
gosub RemovePlayer
open #1,dr$+"war.news":append #1
print #1,date$ ;": ";a3$;" has been defeated!":close
goto Restart
HallFame
print '
_____________________________________________________________________________
| |
| Hall of Fame |
|_____________________________________________________________________________|
| |
| Date Name Total # of kills |
| -------------- --------------------------------------- ------------------ |'
copy dr$+"war.fame"
print "|_____________________________________________________________________________|
close:open #1,dr$+"top.score"
input #1,ka$:input #1,ka
close
print \" Most Brutal Conqueror => ";:gosub invon:print ka$;:gosub invoff:print " with "ka" Total Kills."
goto MainCommand
switch
print \"Choose your emulation:"
print \"1) Proterm Special"
print "2) Datamedia 1500"
print "3) ANSI/VT100"
print \"==> " ;:input ka$
if not(instr(ka$,"123")) goto maincommand
if ka$="3" print \"Emulation => ANSI/VT100":an=1:pt=0:goto maincommand
if ka$="2" print \"Emulation => Datamedia 1500":an=0:pt=0
if ka$="1" print \"Emulation => Proterm Special":an=0:pt=1
print \"Turn your emulation on now and your status bar off, and press <CR>. ";
input @3 ka$
goto maincommand
mapview
if gp=0 print \"You must join a game first!":goto MainCommand
if (pt) or (an) link "a:new.army2","viewmap":else link "a:new.army","viewmap"
Screen
print #3 chr$(30);chr$(31+x);chr$(31+y);
if (pt) or ((pt=0) and (an=0)) print #4 chr$(30);chr$(31+x);chr$(31+y);
if AN print #4 chr$(27); "["y";"x"f";
return
InvOn
print #3 chr$(15);
if (pt) or ((pt=0) and (an=0)) print #4 chr$(15);
if an print #4 chr$(27);"[1m";
return
InvOff
print #3 chr$(14);
if (pt) or ((pt=0) and (an=0)) print #4 chr$(14);
if an print #4 chr$(27);"[0m";
return
Home
print #3 chr$(12);
if (pt) or ((pt=0) and (an=0)) print #4 chr$(12);
if an print #4 chr$(27);"[H";chr$(27);"[J";
return
topscrn
lp$=right$(" "+str$(un),4):clear #9
print #9,cn$,a1$" "a2$" of "a4$", "a5$,nibble(6)
print #9,tc,ul,dl,bp,ph$,lc$,lp$,pa$
for ka=1 to 34:print #9,flag(ka);:next
print ^
poke 34,4
print sc$
return
credits
print \" by:"
x = random(100)
if x>50 print \" Mach Three and Bob Noxious"
if x<51 print \" Bob Noxious and Mach Three"
return